Skip to content

[LinkTest] Fix speed change (200G->400g) test issue#969

Open
Rancho333-CLS wants to merge 2 commits intofacebook:mainfrom
Rancho333-CLS:LinkTest_speedChange
Open

[LinkTest] Fix speed change (200G->400g) test issue#969
Rancho333-CLS wants to merge 2 commits intofacebook:mainfrom
Rancho333-CLS:LinkTest_speedChange

Conversation

@Rancho333-CLS
Copy link
Contributor

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

The AgentEnsembleSpeedChangeTest.TWOHUNDREDGToFOURHUNDREDG test case in the link test failed.

The root cause is that after the flex port configuration is applied, the variable cablePorts_ is not updated. As a result , FBOSS attempts to access ports that have already been removed, which leads to a crash.

For example, a port is configured in 8x200G mode, with port IDs 1, 2, 3, 4, 5, 6, 7, and 8.
After performing a speed change to switch it to 2x400G mode, only port IDs 1 and 5 remain.
However, since cabledPorts_ is not updated, the system still attempts to check the non-existent ports 2, 3, 4, 6, 7, and 8.

Updating the cabledPorts_ variable after applying the new configuration resolves the issue.

Test Plan

All the pre-commit run checks have passed.

[root github-rancho]# git commit -m "[LinkTest] Fix speed change (200G->400g) test issue"                          
clang-format.............................................................Passed                                   
black................................................(no files to check)Skipped                                   
shellcheck...........................................(no files to check)Skipped
shfmt................................................(no files to check)Skipped                                   
trim trailing whitespace.................................................Passed                                   
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check json...........................................(no files to check)Skipped
check for merge conflicts................................................Passed                                   
ruff check...........................................(no files to check)Skipped

After rebuilding the sai_mono_link_test-sai_impl binary, the test result is PASSED.

[       OK ] AgentEnsembleSpeedChangeTest.TWOHUNDREDGToFOURHUNDREDG (99844 ms)
[----------] 1 test from AgentEnsembleSpeedChangeTest (99844 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (99844 ms total)
[  PASSED  ] 1 test.

Please find the complete test log here.

@Rancho333-CLS Rancho333-CLS requested a review from a team as a code owner March 2, 2026 06:50
@meta-cla meta-cla bot added the CLA Signed label Mar 2, 2026
@harshitgulati18
Copy link
Contributor

Thank you for the fix. Which platform is this for?

@Rancho333-CLS
Copy link
Contributor Author

In theory, this can be reproduced on all platforms, as long as the number of logical ports decreases after a speed change. I discovered and fixed it on IceCube.

// updated
applyNewConfig(newConfig);

updateCablePorts();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave a comment above this line that we need to update cabled ports since the previous speed change may add or remove ports

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@meta-codesync
Copy link

meta-codesync bot commented Mar 3, 2026

@harshitgulati18 has imported this pull request. If you are a Meta employee, you can view this in D95063445.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants